package com.azunitech.apm.bundles.shell.commands;

import java.io.PrintStream;
import org.osgi.framework.BundleContext;
import com.azunitech.apm.bundles.shell.BasicCommand;

/*
 * Tests if server is running in a non-error state. 
 * The server will respond with imok if it is running. Otherwise it will not respond at all.
 */
public class CommandRUOK extends BasicCommand<BundleContext>
{
	private static final String CMD_RUOK = "ruok";
	private static final String CMD_DESC = "Tests if server is running in a non-error state.\r\n" 
						+ "      The server will respond with imok if it is running.\r\n" 
						+ "      Otherwise it will not respond at all.";
	
	public String getKey()
	{
		return CommandRUOK.CMD_RUOK;
	}

	public String getDesc() 
	{
		return CommandRUOK.CMD_DESC;
	}
	
	public void exec(String args, PrintStream out, PrintStream err) 
	{
		out.println("imok");
	}
}
